package com.java.wechat.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.java.wechat.entity.MyFriends;
import com.java.wechat.entity.vo.MyFriendsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author jiangli
 * @email 31346337@qq.com
 * @date 2019-11-01 19:47:34
 */
@Mapper
public interface MyFriendsDao extends BaseMapper<MyFriends> {

	@Select("SELECT u.`id` friendUserId,u.`username` friendUsername,u.`face_image` friendFaceImage,u.`nickname` friendNickname FROM `my_friends` m LEFT JOIN `user` u ON m.`my_friend_user_id` = u.`id` WHERE m.`my_user_id` = #{userId}")
	List<MyFriendsVO> queryMyFriends(String userId);
	
}
